<?php

namespace app\api\controller\driver;

use app\common\controller\Api;
use app\common\service\driver\OrderService;

/**
 * 司机端-首页接口
 * @ApiWeigh (90)
 */
class Index extends Api
{
    protected $noNeedLogin = [''];
    protected $noNeedRight = ['*'];

    public function _initialize()
    {
        parent::_initialize();
    }


    /**
     * 首页
     *
     * @ApiMethod (POST)
     * @ApiReturnParams (name=data,type="object",description=要返回的数据)
     * @ApiReturn ({"code": 1,"msg": "首页","time": "1694660842","data": {"is_online": "在线状态:0=下线,1=在线","today_order_amount": "今日收入","today_order_num": "今日订单","afoot_order_num": "进行中的订单"}})
     */
    public function index()
    {
        $user = $this->auth->getUser();
        $result = OrderService::index_driver($user);
        $this->success('首页', $result);
    }

}
